﻿using UnityEngine;
using System.Collections;

public class instruc : MonoBehaviour {

		public Texture2D healthpick;
		public Texture2D armorpick;
		public GameObject bakground;
		Vector2 pos = new Vector2(20, 20);
		Vector2 size = new Vector2(Screen.width - 20,Screen.height - 20);
		string move = "Movement: \n'W': Moves you Up. \n" +
			"'S': Moves you Down \n'A': Moves you Left" +
				"\n'D': Move you Right";
		string instruct = "Instructions:";
		string fightcon = "Targeting:\n Aim with the mouse cursor.\n To fire click 'Left Mouse'.\n Press 'R' to reload.";
		string pickUps = "Collectables: \n Weapons: You will find weapons around \n the map move overthem to pick them up.\n\n \n" +
			"Health: You will find health pick ups\nthat restore a portion of your health." +
				"\n\nPress 'Tab' to oben your character panel\n and equip collected items." +
				"\n\nPress 'E' near doors locked doors when you have a key\n to open them";
		Vector2 movepos = new Vector2(130, 100);
		Vector2 pickpos = new Vector2(260, 200);
		Vector2 fightpos = new Vector2(170, 100);
		// Use this for initialization
		//instruct.fontSize;
		void OnGUI() {
			GUI.BeginGroup (new Rect (pos.x, pos.y, size.x, size.y));
		GUI.Box(new Rect(20 * (Screen.width/914f), 20 * (Screen.height/514f), 350* (Screen.width/914f), 350* (Screen.height/514f)), instruct);
		GUI.Box (new Rect (40* (Screen.width/914f), 40* (Screen.height/514f), movepos.x* (Screen.width/914f), movepos.y* (Screen.height/514f)), move);
		GUI.Box (new Rect (195* (Screen.width/914f), 40* (Screen.height/514f), fightpos.x* (Screen.width/914f), fightpos.y* (Screen.height/514f)), fightcon);
		GUI.Box (new Rect (80* (Screen.width/914f), Screen.height - (350)* (Screen.height/514f), pickpos.x* (Screen.width/914f), pickpos.y* (Screen.height/514f)), pickUps);
		if(GUI.Button(new Rect(300* (Screen.width/914f),20* (Screen.height/514f),50* (Screen.width/914f),20* (Screen.height/514f)), "Exit")) {
			enabled = false;
			}
		GUI.BeginGroup (new Rect (30* (Screen.width/914f), Screen.height - (290)* (Screen.height/514f), 50* (Screen.width/914f), 50), armorpick);
			GUI.EndGroup ();
		GUI.BeginGroup(new Rect(30* (Screen.width/914f), Screen.height-(230), 50* (Screen.width/914f), 50* (Screen.height/514f)), healthpick);
			GUI.EndGroup();
			GUI.EndGroup();
		}
		
	}
